# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mimic1
pkgver=1.3.0.1
pkgrel=0
pkgdesc="Mycroft's TTS engine, based on CMU's Flite (Festival Lite)"
url="https://mimic.mycroft.ai/"
# s390x is an unsupported architecture
arch="all !s390x"
license="MIT AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND Apache-2.0 AND CDLA-Permissive-1.0"
makedepends="automake autoconf libtool pcre2-dev pulseaudio-dev alsa-lib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/mycroftai/mimic1/archive/$pkgver/mimic1-$pkgver.tar.gz
	fix-musl-incompabilities.patch
	"

prepare() {
	default_prepare

	./autogen.sh
}

build() {
	CFLAGS="$CFLAGS -Wno-error=free-nonheap-object" ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-shared
	make
}

check() {
	make check
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
df6b56ea8e02ffd2c02090ff99e722638c962c278cb5354fcc75d010bb4a4e1f830855c8637e44d9f72007810b34df24eeaba39e7767b3502e49ce04263569f4  mimic1-1.3.0.1.tar.gz
dccf3734a16a6ac334a9fed3feca83adabd04c7c8724a9c81b36c765d02cc34aefe16d622f658f5ac2efeed2e1174531ec47ecd92403a1f53f54be1d62f0f7b6  fix-musl-incompabilities.patch
"
